home *** CD-ROM | disk | FTP | other *** search
- Path: news1.h1.usa.pipeline.com!usenet
- From: grantp@usa.pipeline.com(Pete)
- Newsgroups: comp.lang.c++
- Subject: Re: No struct in C++!!?
- Date: 16 Feb 1996 11:21:41 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4g1pc5$lsg@news1.usa.pipeline.com>
- NNTP-Posting-Host: pipe4.h1.usa.pipeline.com
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete)
- X-Newsreader: Pipeline USA v3.3.0
-
- On Feb 14, 1996 15:16:18 in article <No struct in C++!!?>,
- 'gbw@harrier.am.qub.ac.uk (Georg Woste)' wrote:
-
-
- >Hi,
- >
- >a beginners question: I found in different C++ books examples of C++
- programms
- >which contain type declarations and definitions in the main() programm -
- for
- >example a struct - as in C.
- >My question is, whether this is a contradiction
- >to the paradigm of C++. Shouldn't be everything in a C++ programm
- >either classes, objects or the interaction between objects?
- >So is it bad C++ style, to use functions or data outside from
- >classes (objects)?
- >
- No. One of the advantages of C++ is that it doesn't force you into
- using any paradigm just for the sake of it. C structures are
- perfectly acceptable when they fit the need.
-
- BTW, in C++ the only difference between structures and classes
- is their default accessibility of members -- public for struct's
- and private for classes.
-
- --
- Pete Grant
- Kalevi, Inc.
- Software Engineering & development
-